********************************************************************************
* Data preparation: Transfer variables imputed by the CBO
********************************************************************************

* all imputations presented at the person level
/* 
"The unit of analysis varies according to how each means-tested transfer program is
administered. Medicaid and SSI are imputed at the person level; SNAP and housing
assistance are imputed at the household level. The data in the accompanying data sets are
designed to be matched to person-level CPS ASEC data sets. Therefore, all imputations are
presented at the person level. Household-level benefits are assigned only to the head of
the household."
*/

* CBO imputed food stamps variable
bysort serial: egen snap_impute_val_hh = total(snap_impute_val), missing
label var snap_impute_val_hh "total household CBO imputed food stamps, aggregated from individual"
count if snap_impute_val_hh > snap_impute_val & snap_impute_val != 0

* CBO imputed SSI variable
bysort serial: egen ssi_impute_val_hh = total(ssi_impute_val), missing
label var ssi_impute_val_hh "total household CBO imputed SSI, aggregated from individual"

* CBO imputed housing assistance variable
bysort serial: egen housing_assist_impute_val_hh = total(housing_assist_impute_val), missing
label var housing_assist_impute_val_hh "total household CBO imputed housing assistance, aggregated from individual"
count if housing_assist_impute_val_hh > housing_assist_impute_val & housing_assist_impute_val != 0
replace housing_assist_impute_val_hh = 0 if housing_assist_impute_val_hh == .

* CBO imputed Medicaid variable
bysort serial: egen mcaid_impute_val_hh = total(mcaid_impute_val), missing
label var mcaid_impute_val_hh "total household CBO imputed Medicaid, aggregated from individual"